package com.kanas.webak.config.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.kanas.framework.support.AbstractModel;

@Entity
@Table(name="kanas_properties")
@JsonIgnoreProperties({"group"})
public class Properties extends AbstractModel {

	@Transient
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="p_key", length=20)
	private String key;
	@Column(name="p_value", length=200)
	private String value;
	@Column(name="type", length=20)
	private String type;
	@Column(name="validator", length=100)
	private String validator;
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="group_code",referencedColumnName="code")
	private PropertiesGroup group;
	@Column(name="sort_number")
	private Integer sortNumber;
	
	public Properties() {}
	
	@Override
	public String toIdString() {
		return key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getValidator() {
		return validator;
	}

	public void setValidator(String validator) {
		this.validator = validator;
	}

	public PropertiesGroup getGroup() {
		return group;
	}

	public void setGroup(PropertiesGroup group) {
		this.group = group;
	}

	public Integer getSortNumber() {
		return sortNumber;
	}

	public void setSortNumber(Integer sortNumber) {
		this.sortNumber = sortNumber;
	}

}
